home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 7: Sunsite / Linux Cubed Series 7 - Sunsite Vol 1.iso / system / printing / nenscrip.000 / nenscrip / nenscript-1.13++ / Fix-2 < prev    next >
Text File  |  1992-11-24  |  7KB  |  280 lines

  1. Please forward this to the maintainer of nenscript.
  2.  
  3. In the process of porting nenscript to a 386-bsd computer I made an attempt 
  4. to fix all warnings given by gcc -Wall. Here are the diffs from my previous
  5. version (with ISO Latin1 support), most fixes seems quite trivial, but there
  6. was one bug in the handling of multiple files in main.c, which seems
  7. quite important.
  8.  
  9. Regards
  10. Jonas Lagerblad
  11.  
  12. ----------
  13. diff -c /nfs/albert/src/nenscript-1.13/machdep.h ./machdep.h
  14. *** /nfs/albert/src/nenscript-1.13/machdep.h    Thu Nov 19 14:34:27 1992
  15. --- ./machdep.h    Tue Nov 24 10:41:36 1992
  16. ***************
  17. *** 41,46 ****
  18. --- 41,49 ----
  19.   
  20.   # include <pwd.h>
  21.   # include <string.h>
  22. + # ifdef __STDC__
  23. + #  include <unistd.h>
  24. + # endif
  25.   
  26.   # define    LPR        "lpr -P "        /* spooler with option to set name of printer */
  27.   
  28. diff -c /nfs/albert/src/nenscript-1.13/main.c ./main.c
  29. *** /nfs/albert/src/nenscript-1.13/main.c    Wed Oct  7 15:06:46 1992
  30. --- ./main.c    Tue Nov 24 10:57:21 1992
  31. ***************
  32. *** 17,26 ****
  33.   #include "defs.h"
  34.   
  35.   #include "version.h"
  36. - #include "postscri.h"
  37.   #include "print.h"
  38.   #include "main.h"
  39.   #include "paper.h"
  40.   
  41.   /********************************
  42.     defines
  43. --- 17,26 ----
  44.   #include "defs.h"
  45.   
  46.   #include "version.h"
  47.   #include "print.h"
  48.   #include "main.h"
  49.   #include "paper.h"
  50. + #include "postscri.h"
  51.   
  52.   /********************************
  53.     defines
  54. ***************
  55. *** 143,149 ****
  56.               }
  57.             }
  58.             if (copies < 1) {
  59. !             fprintf (stderr, "%s: illegal number of copies specified - defaulting to one\n");
  60.               copies = 1;
  61.             }
  62.             goto next_argv;
  63. --- 143,149 ----
  64.               }
  65.             }
  66.             if (copies < 1) {
  67. !             fprintf (stderr, "%s: illegal number of copies specified - defaulting to one\n", progname);
  68.               copies = 1;
  69.             }
  70.             goto next_argv;
  71. ***************
  72. *** 349,357 ****
  73.             if (*++ARGV[0])
  74.               s = ARGV[0];
  75.             else {
  76. !             if (ARGC < 1)
  77.                 fprintf (stderr, "%s: -t option requires argument\n", progname);
  78. !             else {
  79.                 --ARGC;
  80.                 s = *++ARGV;
  81.               }
  82. --- 349,358 ----
  83.             if (*++ARGV[0])
  84.               s = ARGV[0];
  85.             else {
  86. !             if (ARGC < 1) {
  87.                 fprintf (stderr, "%s: -t option requires argument\n", progname);
  88. !           s = 0;        /* We should flag the error in some way */
  89. !             } else {
  90.                 --ARGC;
  91.                 s = *++ARGV;
  92.               }
  93. ***************
  94. *** 486,492 ****
  95.     int argc;
  96.     char *s;
  97.     char **argv;
  98. -   int i;
  99.   
  100.     if (env == NULL)
  101.       return;
  102. --- 487,492 ----
  103. ***************
  104. *** 658,664 ****
  105.         perror (*argv);
  106.       else {
  107.         print_file (inputstream, outputstream, (filetitle ? filetitle : *argv), line_numbers);
  108. !       inputstream == NULL;
  109.       }
  110.       argv++;
  111.     }
  112. --- 658,665 ----
  113.         perror (*argv);
  114.       else {
  115.         print_file (inputstream, outputstream, (filetitle ? filetitle : *argv), line_numbers);
  116. !       fclose(inputstream);
  117. !       inputstream = NULL;
  118.       }
  119.       argv++;
  120.     }
  121. diff -c /nfs/albert/src/nenscript-1.13/makefile ./makefile
  122. *** /nfs/albert/src/nenscript-1.13/makefile    Thu Nov 19 18:23:19 1992
  123. --- ./makefile    Tue Nov 24 10:56:48 1992
  124. ***************
  125. *** 33,39 ****
  126.   CP    =    cp
  127.   RM    =    rm
  128.   INSTALL    =    /etc/install
  129. ! INSTALL    =    install
  130.   
  131.   all debug:    $(PROG)
  132.   
  133. --- 33,39 ----
  134.   CP    =    cp
  135.   RM    =    rm
  136.   INSTALL    =    /etc/install
  137. ! INSTALL    =    install -c
  138.   
  139.   all debug:    $(PROG)
  140.   
  141. diff -c /nfs/albert/src/nenscript-1.13/postscri.c ./postscri.c
  142. *** /nfs/albert/src/nenscript-1.13/postscri.c    Thu Nov 19 18:41:52 1992
  143. --- ./postscri.c    Tue Nov 24 10:41:34 1992
  144. ***************
  145. *** 24,29 ****
  146. --- 24,31 ----
  147.   #include "fontwidt.h"
  148.   #include "font_lis.h"
  149.   
  150. + #include <ctype.h>
  151.   /********************************
  152.     defines
  153.    ********************************/
  154. ***************
  155. *** 181,187 ****
  156.     /* call the StartPage procedure with the appropriate arguments */
  157.     fprintf (stream, "(%li) ", PageNum);
  158.     PrintPSString (stream, CurrentFilename, strlen (CurrentFilename));
  159. !   fprintf (stream, " StartPage\n", PageNum);
  160.   
  161.     /* set X and Y location */
  162.     X = LM;
  163. --- 183,189 ----
  164.     /* call the StartPage procedure with the appropriate arguments */
  165.     fprintf (stream, "(%li) ", PageNum);
  166.     PrintPSString (stream, CurrentFilename, strlen (CurrentFilename));
  167. !   fprintf (stream, " StartPage\n");
  168.   
  169.     /* set X and Y location */
  170.     X = LM;
  171. ***************
  172. *** 258,264 ****
  173.   int  first;
  174.   
  175.   {
  176. -   char *p;
  177.     long i;
  178.   
  179.     if (!touched_page)
  180. --- 260,265 ----
  181. ***************
  182. *** 296,302 ****
  183.   char *line;
  184.   
  185.   {
  186. -   int l;
  187.     int first = True;
  188.     char *p;
  189.     char *q;
  190. --- 297,302 ----
  191. ***************
  192. *** 622,628 ****
  193.   
  194.     /* define a variable for our body font, and calculate the character width for later use */
  195.     fprintf (stream, "/BodyF { %li /%s /%s-Latin1 ChgFnt } def\n", BFH, bodyfont,
  196. !      bodyfont, BFH);
  197.     fprintf (stream, "/CW BodyF ( ) stringwidth pop def\n");
  198.   
  199.     /* define variables for various other font used - title, gaudy page number, gaudy date, gaudy title */
  200. --- 622,628 ----
  201.   
  202.     /* define a variable for our body font, and calculate the character width for later use */
  203.     fprintf (stream, "/BodyF { %li /%s /%s-Latin1 ChgFnt } def\n", BFH, bodyfont,
  204. !      bodyfont);
  205.     fprintf (stream, "/CW BodyF ( ) stringwidth pop def\n");
  206.   
  207.     /* define variables for various other font used - title, gaudy page number, gaudy date, gaudy title */
  208. diff -c /nfs/albert/src/nenscript-1.13/print.c ./print.c
  209. *** /nfs/albert/src/nenscript-1.13/print.c    Thu Oct  1 18:02:54 1992
  210. --- ./print.c    Tue Nov 24 10:41:33 1992
  211. ***************
  212. *** 18,23 ****
  213. --- 18,24 ----
  214.   #include "defs.h"
  215.   
  216.   #include "print.h"
  217. + #include "paper.h"
  218.   #include "postscri.h"
  219.   #include "main.h"
  220.   
  221. ***************
  222. *** 42,48 ****
  223.     char line[8192+1];
  224.     int touched = False;
  225.     char *p;
  226. !   long line_num;
  227.     char *buffer;
  228.     int  bufflen;
  229.   
  230. --- 43,49 ----
  231.     char line[8192+1];
  232.     int touched = False;
  233.     char *p;
  234. !   long line_num = 1;
  235.     char *buffer;
  236.     int  bufflen;
  237.   
  238. ***************
  239. *** 52,58 ****
  240.     if (line_numbers) {
  241.       buffer  += 8;
  242.       bufflen -= 8;
  243. !     sprintf (line, "%7lu:", line_num = 1);
  244.     }
  245.   
  246.     StartDocument (output, filename);
  247. --- 53,59 ----
  248.     if (line_numbers) {
  249.       buffer  += 8;
  250.       bufflen -= 8;
  251. !     sprintf (line, "%7lu:", line_num);
  252.     }
  253.   
  254.     StartDocument (output, filename);
  255. diff -c /nfs/albert/src/nenscript-1.13/version.h ./version.h
  256. *** /nfs/albert/src/nenscript-1.13/version.h    Wed Oct  7 15:06:30 1992
  257. --- ./version.h    Tue Nov 24 11:00:14 1992
  258. ***************
  259. *** 14,22 ****
  260.    */
  261.   
  262.   #ifndef US_VERSION
  263. ! char * version_string = "nenscript v1.13 8-October-1992";
  264.   #else
  265. ! char * version_string = "nenscript v1.13 (US version) 8-October-1992";
  266.   #endif
  267.   
  268.   char * copyright_string = "\
  269. --- 14,22 ----
  270.    */
  271.   
  272.   #ifndef US_VERSION
  273. ! char * version_string = "nenscript v1.13++ 24-November-1992";
  274.   #else
  275. ! char * version_string = "nenscript v1.13++ (US version) 24-November-1992";
  276.   #endif
  277.   
  278.   char * copyright_string = "\
  279.